'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 生存子项
 * @author sundbcn@gmail.com (sun debing)
 */

var moment = require('moment');
var mongoose = require('mongoose');

var surviveItemSchema = new mongoose.Schema({
    // boss id
    survive_id: {
        type: Number,
        require: true
    },

    // 攻击的记录
    attack_list: []
});

/**
 * 获取生存的id
 * @return {[type]} [description]
 */
surviveItemSchema.methods.getSurviveId = function () {
    return this.survive_id;
};

surviveItemSchema.methods.addAttack = function () {

};

surviveItemSchema.methods.getAttackNum = function () {
    return this.attack_list.length;
};

if (!surviveItemSchema.options.toJSON) {
    surviveItemSchema.options.toJSON = {};
}
/* jshint unused:false */
surviveItemSchema.options.toJSON.transform = function (doc, ret) {
    delete ret.pass_time;
};

module.exports = surviveItemSchema;
